package com.yudaxian.bi.common;

/**
 * 自定义错误码
 *
 * @author <a href="https://github.com/liyupi">程序员鱼皮</a>
 * @from <a href="https://yupi.icu">编程导航知识星球</a>
 */
public enum ErrorCode {

    SUCCESS(0, "ok"),
    PARAMS_ERROR(40000, "请求参数错误"),
    NOT_LOGIN_ERROR(40100, "未登录"),
    NO_AUTH_ERROR(40101, "无权限"),
    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    TOO_MANY_REQUEST_ERROR(42900, "请求过于频繁"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    OPERATION_ERROR(50001, "操作失败"),
    USER_REGISTERED_ERROR(50002, "用户已被注册"),
    PASSWORD_ERROR(50003, "密码错误"),
    MULTI_UPDATE_DELETE_ERROR(50004, "多参数更新，删除，必须有非空条件"),
    CHECK_PARAM_NULL_ERROR(50005, "校验参数是否为空失败"),
    PASSWORD_NOT_MATCH_ERROR(50006, "两次密码不一致"),
    CHECK_CODE_ERROR(50007, "验证码错误"),
    CHECK_CODE_EXPIRED_ERROR(50008, "验证码过期"),

    ;

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
